package com.gxaedu.shiro.controller;

import com.gxaedu.shiro.dto.ResponseData;
import com.gxaedu.shiro.dto.ResultData;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class MemberController {


    /**
     * 会员列表的页面
     * @return
     */
    @GetMapping("/member/list/page")
    @RequiresRoles(value = {"超级管理员","会员管理员"},logical = Logical.OR)
    public String list(){
        return "member/member-list";
    }


    /**
     * 删除数据
     * @param memberId
     * @return
     */
    @PostMapping("/member/delete")
    @ResponseBody
    @RequiresPermissions("/member/delete")
    public ResultData delete(Long memberId){
        // 模拟删除
        return ResponseData.success(memberId);
    }



}
